package com.boboPlanet.user.service.impl;

import com.boboPlanet.user.async.AsyncTask;
import com.boboPlanet.user.mapper.UserDetailOperationMapper;
import com.boboPlanet.user.mapper.UserResumeMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @Description: TODO
 * @Author: mis_wu
 * @Date: 2023/3/13
 **/
@Slf4j
@Component
public class FileUploadServiceFactory {

    @Resource
    private UserDetailOperationMapper userDetailOperationMapper;

    @Resource
    private UserResumeMapper userResumeMapper;

    @Resource
    private AsyncTask asyncTask;


    public String uploadResumeAvatar(MultipartFile file){
        return new UploadFileHandlerImpl(asyncTask,null,userResumeMapper)
                .uploadResumeAvatar(file);
    }


    public String uploadUserAvatar(MultipartFile file, String fileType){
        return new UploadFileHandlerImpl(asyncTask,userDetailOperationMapper,null)
                .uploadUserAvatar(file,fileType);
    }

}
